package com.liugh.entity.standard;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Fatao on 2018/10/30 .
 */
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("standard_approve")
public class StandardApprove extends Model<StandardApprove> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @JsonProperty("id")
    private int id;

    /**
     * 对应standardItem表的ID
     */
    @TableField("stand_item_id")
    @NonNull
    private int standardItemId;

    /**
     * 用户编号
     */
    @TableField("user_no")
    private String userNo;


    /**
     * 审批状态
     * 0.正在审批
     * 1.已通过
     * 2.未通过
     * 3.正在碎片化
     * 4.碎片化失败
     */
    @TableField("status")
    private int status;

    /**
     * 申请时间
     */
    @TableField("apply_time")
    private Date applyTime;

    /**
     * 申请意见
     */
    @TableField("apply_note")
    private String applyNote;

    /**
     * 审批意见
     */
    @TableField("approve_note")
    private String approveNote;

    /**
     * 审批处理时间
     */
    @TableField("agree_time")
    private Date agreeTime;

    /**
     * 审批人编号
     */
    @TableField("approve_user_no")
    private String approveUserNo;

    @TableField(exist = false)
    private String applyUserName;

    @TableField(exist = false)
    private String approveUserName;

    @TableField(exist = false)
    private String standardItemNo;

    @TableField(exist = false)
    private String standardItemName;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
